package order.server.impl;

import common.server.entity.InsideRequestMessage;
import common.server.entity.InsideResponseMessage;
import common.server.entity.OutsideRequestMessage;
import common.server.entity.OutsideResponseMessage;
import order.api.entity.param.OrderParam;
import order.api.entity.result.OrderPojo;
import order.api.service.IOrderService;
import order.server.dao.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Title: OrderServiceImpl
 * @ProjectName com-bigwavn-group
 * @Description: 商品中心-业务层实现操作
 * @author: wangweitao 1749343503@qq.com
 * @date: 2019/5/29 15:22
 * @version: V1.0.0
 */
public class OrderServiceImpl implements IOrderService {

    @Autowired
    private OrderMapper OrderMapper;

    /**
     * @Description: 商品中心-商品列表查询
     * @param: [trace, req]
     * @return: common.server.entity.InsideResponseMessage<java.util.List<Order.api.platform.entity.result.OrderPojo>>
     * @throws
     * @author: wangweitao
     * @date: 2019/7/8 17:38
     */
    @Override
    public InsideResponseMessage<List<OrderPojo>> getOrderList(String trace, InsideRequestMessage<OrderParam> req) {

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("id",req.getReqBody().getId());
        List<OrderPojo> list= OrderMapper.getOrderList(map);
        InsideResponseMessage<List<OrderPojo>> OrderRes = new InsideResponseMessage<List<OrderPojo>>();
        OrderRes.setRspBody(list);
        return OrderRes;
    }
    /**
     * @Description: 商品中心-商品数量查询
     * @param: [trace, req]
     * @return: common.server.entity.InsideResponseMessage<java.util.List<Order.api.platform.entity.result.OrderPojo>>
     * @throws
     * @author: wangweitao
     * @date: 2019/7/8 17:38
     */
    @Override
    public InsideResponseMessage<OrderPojo> getOrderCount(String trace, InsideRequestMessage<OrderParam> req) {
        return null;
    }

    @Override
    public OutsideResponseMessage<OrderPojo> getOrderLists(String trace, OutsideRequestMessage<OrderParam> req) {
        return null;
    }
}
